// MESSAGE GNSS_DATA support class

#pragma once

namespace mavlink {
namespace fppa {
namespace msg {

/**
 * @brief GNSS_DATA message
 *
 * GNSS_DATA
 */
struct GNSS_DATA : mavlink::Message {
    static constexpr msgid_t MSG_ID = 33;
    static constexpr size_t LENGTH = 154;
    static constexpr size_t MIN_LENGTH = 154;
    static constexpr uint8_t CRC_EXTRA = 169;
    static constexpr auto NAME = "GNSS_DATA";


    uint64_t time; /*<  time. */
    uint32_t dt; /*<  dt. */
    float lon; /*<  longitude. */
    float lat; /*<  latitude. */
    float height; /*<  height. */
    float east; /*<  east. */
    float north; /*<  north. */
    float up; /*<  up. */
    float eastVel; /*<  eastVel. */
    float northVel; /*<  northVel. */
    float upVel; /*<  upVel. */
    float heading; /*<  heading. */
    float pitch; /*<  pitch. */
    float tracktrue; /*<  tracktrue. */
    float vel; /*<  vel. */
    float roll; /*<  roll. */
    int32_t pos_qual; /*<  pos_qual. */
    int32_t heading_qual; /*<  heading_qual. */
    int32_t satNum1; /*<  satNum1. */
    int32_t satNum2; /*<  satNum2. */
    int32_t gps_Num; /*<  gps_num. */
    int32_t bds_Num; /*<  gps_num. */
    int32_t glo_Num; /*<  gps_num. */
    float pdop; /*<  pdop (0.5..99.9). */
    float hdop; /*<   hdop (0.5..99.9). */
    float vdop; /*<   vdop (0.5..99.9). */
    uint8_t year; /*<   component. */
    uint8_t month; /*<   component. */
    uint8_t day; /*<   component. */
    uint8_t hour; /*<   component. */
    uint8_t minute; /*<   component. */
    uint8_t second; /*<   component. */
    float data1; /*<  data1 */
    float data2; /*<  data2 */
    float data3; /*<  data3 */
    float data4; /*<  data4 */
    float data5; /*<  data5 */
    float data6; /*<  data6 */
    float data7; /*<  data7 */
    float data8; /*<  data8 */
    float data9; /*<  data9 */
    float data10; /*<  data10 */


    inline std::string get_name(void) const override
    {
            return NAME;
    }

    inline Info get_message_info(void) const override
    {
            return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
    }

    inline std::string to_yaml(void) const override
    {
        std::stringstream ss;

        ss << NAME << ":" << std::endl;
        ss << "  time: " << time << std::endl;
        ss << "  dt: " << dt << std::endl;
        ss << "  lon: " << lon << std::endl;
        ss << "  lat: " << lat << std::endl;
        ss << "  height: " << height << std::endl;
        ss << "  east: " << east << std::endl;
        ss << "  north: " << north << std::endl;
        ss << "  up: " << up << std::endl;
        ss << "  eastVel: " << eastVel << std::endl;
        ss << "  northVel: " << northVel << std::endl;
        ss << "  upVel: " << upVel << std::endl;
        ss << "  heading: " << heading << std::endl;
        ss << "  pitch: " << pitch << std::endl;
        ss << "  tracktrue: " << tracktrue << std::endl;
        ss << "  vel: " << vel << std::endl;
        ss << "  roll: " << roll << std::endl;
        ss << "  pos_qual: " << pos_qual << std::endl;
        ss << "  heading_qual: " << heading_qual << std::endl;
        ss << "  satNum1: " << satNum1 << std::endl;
        ss << "  satNum2: " << satNum2 << std::endl;
        ss << "  gps_Num: " << gps_Num << std::endl;
        ss << "  bds_Num: " << bds_Num << std::endl;
        ss << "  glo_Num: " << glo_Num << std::endl;
        ss << "  pdop: " << pdop << std::endl;
        ss << "  hdop: " << hdop << std::endl;
        ss << "  vdop: " << vdop << std::endl;
        ss << "  year: " << +year << std::endl;
        ss << "  month: " << +month << std::endl;
        ss << "  day: " << +day << std::endl;
        ss << "  hour: " << +hour << std::endl;
        ss << "  minute: " << +minute << std::endl;
        ss << "  second: " << +second << std::endl;
        ss << "  data1: " << data1 << std::endl;
        ss << "  data2: " << data2 << std::endl;
        ss << "  data3: " << data3 << std::endl;
        ss << "  data4: " << data4 << std::endl;
        ss << "  data5: " << data5 << std::endl;
        ss << "  data6: " << data6 << std::endl;
        ss << "  data7: " << data7 << std::endl;
        ss << "  data8: " << data8 << std::endl;
        ss << "  data9: " << data9 << std::endl;
        ss << "  data10: " << data10 << std::endl;

        return ss.str();
    }

    inline void serialize(mavlink::MsgMap &map) const override
    {
        map.reset(MSG_ID, LENGTH);

        map << time;                          // offset: 0
        map << dt;                            // offset: 8
        map << lon;                           // offset: 12
        map << lat;                           // offset: 16
        map << height;                        // offset: 20
        map << east;                          // offset: 24
        map << north;                         // offset: 28
        map << up;                            // offset: 32
        map << eastVel;                       // offset: 36
        map << northVel;                      // offset: 40
        map << upVel;                         // offset: 44
        map << heading;                       // offset: 48
        map << pitch;                         // offset: 52
        map << tracktrue;                     // offset: 56
        map << vel;                           // offset: 60
        map << roll;                          // offset: 64
        map << pos_qual;                      // offset: 68
        map << heading_qual;                  // offset: 72
        map << satNum1;                       // offset: 76
        map << satNum2;                       // offset: 80
        map << gps_Num;                       // offset: 84
        map << bds_Num;                       // offset: 88
        map << glo_Num;                       // offset: 92
        map << pdop;                          // offset: 96
        map << hdop;                          // offset: 100
        map << vdop;                          // offset: 104
        map << data1;                         // offset: 108
        map << data2;                         // offset: 112
        map << data3;                         // offset: 116
        map << data4;                         // offset: 120
        map << data5;                         // offset: 124
        map << data6;                         // offset: 128
        map << data7;                         // offset: 132
        map << data8;                         // offset: 136
        map << data9;                         // offset: 140
        map << data10;                        // offset: 144
        map << year;                          // offset: 148
        map << month;                         // offset: 149
        map << day;                           // offset: 150
        map << hour;                          // offset: 151
        map << minute;                        // offset: 152
        map << second;                        // offset: 153
    }

    inline void deserialize(mavlink::MsgMap &map) override
    {
        map >> time;                          // offset: 0
        map >> dt;                            // offset: 8
        map >> lon;                           // offset: 12
        map >> lat;                           // offset: 16
        map >> height;                        // offset: 20
        map >> east;                          // offset: 24
        map >> north;                         // offset: 28
        map >> up;                            // offset: 32
        map >> eastVel;                       // offset: 36
        map >> northVel;                      // offset: 40
        map >> upVel;                         // offset: 44
        map >> heading;                       // offset: 48
        map >> pitch;                         // offset: 52
        map >> tracktrue;                     // offset: 56
        map >> vel;                           // offset: 60
        map >> roll;                          // offset: 64
        map >> pos_qual;                      // offset: 68
        map >> heading_qual;                  // offset: 72
        map >> satNum1;                       // offset: 76
        map >> satNum2;                       // offset: 80
        map >> gps_Num;                       // offset: 84
        map >> bds_Num;                       // offset: 88
        map >> glo_Num;                       // offset: 92
        map >> pdop;                          // offset: 96
        map >> hdop;                          // offset: 100
        map >> vdop;                          // offset: 104
        map >> data1;                         // offset: 108
        map >> data2;                         // offset: 112
        map >> data3;                         // offset: 116
        map >> data4;                         // offset: 120
        map >> data5;                         // offset: 124
        map >> data6;                         // offset: 128
        map >> data7;                         // offset: 132
        map >> data8;                         // offset: 136
        map >> data9;                         // offset: 140
        map >> data10;                        // offset: 144
        map >> year;                          // offset: 148
        map >> month;                         // offset: 149
        map >> day;                           // offset: 150
        map >> hour;                          // offset: 151
        map >> minute;                        // offset: 152
        map >> second;                        // offset: 153
    }
};

} // namespace msg
} // namespace fppa
} // namespace mavlink
